// i18n(国际化多语言)
import Vue from 'vue'
// 引入饿了么的英文包
import elementEN from 'element-ui/lib/locale/lang/en'
// 引入饿了么的中文包
import elementZH from 'element-ui/lib/locale/lang/zh-CN'
import VueI18n from 'vue-i18n'
// 引入项目语言包
import en from '@/I18n/en'
import zh from '@/I18n/zh'

Vue.use(VueI18n)
export default new VueI18n({
  locale: localStorage.getItem('lang') || 'zh',
  messages: {
    zh: {
      morning: '早安!',
      happyEveryday: '祝你开心每一天~',
      ...elementZH,
      ...zh
    },
    en: {
      morning: 'Good morning!',
      happyEveryday: 'Happy everyday to you~',
      ...elementEN,
      ...en
    }
  }
})
